/* 递推和递归
* 1.约数之和定理
    N = p1^a1 * p2^a2 * p3^a3 * p4^a4 * ... * pk^ak
    约数个数 = (a1+1)*(a2+2)*(a3+3)*...*(ak+1)
    约数之和 = (1+p1+p1^2+...+p^a1)*(1+p2+p2^2+...+p2^a2)*...*(1+pk+pk^2+...+pk^ak)
    等比数列前缀和: Sn = p^0+p^1+...+p^(k-1) = (p^k-1)/(p-1)

    1.k是偶数
        sum(p, k) = p^0+p^1+...+p^(k/2-1)+p^(k/2)+...+p^(k-1)
                  = sum(p, k/2)+p^(k/2)*sum(p, k/2)
                  = (1+p^(k/2))*sum(p, k/2)
    2.k是奇数
        sum(p, k) = p^0+p^1+...+p^(k-1)
                  = p^0+p*(p^0+p^1+...+p^(k-2))
                  = 1 + p * sum(p, k-1)
* 本题:
    先分解A
    A = p1^a1 * ... * pk^ak
    A^B = p1^a1B * ... * pk^akB
*/
#define DEBUG
#pragma GCC optimize("O1,O2,O3,Ofast")
#pragma GCC optimize("no-stack-protector,unroll-loops,fast-math,inline")
#pragma GCC target("avx,avx2,fma")
#pragma GCC target("sse,sse2,sse3,sse4,sse4.1,sse4.2,ssse3")

#include <iostream>
#include <cstring>
#include <unordered_map>
using namespace std;
#define int long long
const int MOD = 9901;
int A, B;
unordered_map<int, int> primes;

void divide(int n)
{
    for(int i = 2; i <= n/i; i++) {
        if(n%i==0) {
            while(n%i == 0) {
                primes[i]++;
                n /= i;
            }
        }
    }
    if(n > 1) primes[n]++; //n本身可能有且仅有一个>sqrt(n)的质因数
}

int qmi(int base, int index, int MOD)
{
    int res = 1;
    while(index)
    {
        if(index&1) res = (res * base) % MOD;
        base = (base*base) % MOD;
        index >>= 1;
    }
    return res;
}

// p^0 + ... + p^k-1
int sum(int p, int k) {
    if(k == 1) return 1;
    if(k&1) //奇数
        // return qmi(p, k-1, MOD) + sum(p, k-1) % MOD;
        return  1 + p * sum(p, k-1) % MOD;
    //偶数
    return (qmi(p, k/2, MOD)+1)*sum(p, k/2) % MOD;
    
}

signed main()
{
    #ifdef DEBUG
        freopen("./in.txt", "r", stdin);
    #else
        ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    #endif
    
    cin >> A >> B;

    //对A分解质因子
    divide(A);
    int res = 1;
    for(auto [p, k] : primes) {
            //质数 质因子的次数
        res = res * sum(p, B*k+1) % MOD;
    }

    if(!A) res = 0;
    cout << res << endl;
    return 0;
}